const domain = "http://ding.chunyesheng.com.cn"

export default {
  loginUrl() {
    const url = '/dinglogin'
    return domain + url
  },
  bindUrl() {
    const url = '/dinglogin'
    return domain + url
  },
  myInfo() {
    const url = '/auth/api/w/auth/users/me'
    return domain + url
  },
  myInstitutionInfo() {
    const url = '/dcom/api/w/institutions/me'
    return domain + url
  },
  operationGroupsUrl() {
    const url = '/dcom/api/w/operationGroups'
    return domain + url
  },
  // 响应方式
  responseMethodDictUrl() {
    const url = '/dcom/api/w/dictionary?s_type=responseMethod'
    return domain + url
  },
  // 服务类型
  worktypeDictUrl() {
    const url = '/dcom/api/w/dictionary?s_type=worktype'
    return domain + url
  },
  // 事件等级
  eventgradeDictUrl() {
    const url = '/dcom/api/w/dictionary?s_type=eventgrade'
    return domain + url
  },
  // 其它类型字典
  dictUrl(type) {
    const url = '/dcom/api/w/dictionary?s_type=' + type
    return domain + url
  },
  // 日报
  workDailyUrl() {
    const url = '/dcom/api/w/workDaily'
    return domain + url
  },
  // 日报分页
  workDailyPageUrl() {
    const url = '/dcom/api/w/workDaily/p'
    return domain + url
  },
  // 日报详情
  workDailyDetailUrl(id) {
    const url = '/dcom/api/w/workDaily/' + id
    return domain + url
  },
  // 周报
  operationSupportWeeklyUrl() {
    const url = '/dcom/api/w/operationSupportWeekly'
    return domain + url
  },
  // 日报查询
  dayWorkList(start, end, unitCode) {
    const url = '/dcom/api/w/workDaily?s_unitCode=' + unitCode + '&s_afEqReportDate=' + start + '&s_beEqReportDate=' + end + '&size=2000&sort=dailyReportDate,asc&sort=serviceStartTime,asc'
    return domain + url
  },
  // 运维组长
  operationGroupLeaderUrl() {
    const url = '/auth/api/w/auth/users?s_roleCode=workerGroupLeader'
    return domain + url
  },
  // 驻场工程师
  residentEngineerUrl() {
    const url = '/auth/api/w/auth/users?s_roleCode=worker'
    return domain + url
  },
  // 机动工程师
  mobileEngineerUrl() {
    const url = '/auth/api/w/auth/users?s_roleCode=backup'
    return domain + url
  },
  // 项目名称
  projectUrl() {
    const url = '/dcom/api/w/project/code/HN'
    return domain + url
  },
  // 巡检项列表
  inspectionItem(category) {
    const url = '/dcom/api/w/hn/inspection/item?s_category=' + category
    return domain + url
  },
  // 巡检项分类字典
  inspectionTypeDictUrl() {
    const url = '/dcom/api/w/dictionary/all/hnInspectionItemType'
    return domain + url
  },
  // 每日巡检的任务列表
  inspectionDayListUrl(status) {
    let code = 's_status=' + status
    if (Array.isArray(status)) {
      code = ''
      for (let i of status) {
        code += '&s_status=' + i
      }
    }
    const url = '/dcom/api/w/hn/inspection/task/p?sort=startDateTime,desc&size=2000&' + code.substring(1)
    return domain + url
  },
  // 每日巡检的详细信息
  inspectionDayDetailUrl(id) {
    const url = '/dcom/api/w/hn/inspection/task/' + id
    return domain + url
  },
  inspectionDayUpdateUrl(id){
    const url = '/dcom/api/w/hn/inspection/task/' + id
    return domain + url
  },
  // 每日巡检结果上报
  inspectionDayUrl(id) {
    const url = '/dcom/api/w/hn/inspection/task/submit/' + id
    return domain + url
  },
  //每日巡检未完成任务计数
  inspectionDayUnfinishedTaskUrl() {
    const url = '/dcom/api/w/hn/inspection/task/unfinished/task/number'
    return domain + url
  },
  // 定期巡检的任务列表
  inspectionRegularListUrl(status) {
    let code = '&s_status=' + status
    if (Array.isArray(status)) {
      code = ''
      for (let i of status) {
        code += '&s_status=' + i
      }
    }
    const url = '/dcom/api/w/hn/inspection/task/health/p?sort=startDateTime,desc&size=2000&' + code.substring(1)
    return domain + url
  },
  // 定期巡检添加附件
  updateTaskAttachmentUrl(id) {
    const url = '/dcom/api/w/hn/inspection/task/health/update/task/attachment/' + id
    return domain + url
  },
  // 定期巡检上传附件
  inspectionRegularUploadUrl() {
    const url = '/dcom/api/w/hn/inspection/task/health/attachment'
    return domain + url
  },
  // 定期巡检删除附件
  inspectionRegularDeleteAttachmentUrl(fsId, id) {
    const url = '/dcom/api/w/hn/inspection/task/health/attachment/' + fsId + '/' + id
    return domain + url
  },
  // 定期巡检的详细信息
  inspectionRegularDetailUrl(id) {
    const url = '/dcom/api/w/hn/inspection/task/health/' + id
    return domain + url
  },
  // 定期巡检结果上报
  inspectionRegularUrl(id) {
    const url = '/dcom/api/w/hn/inspection/task/health/submit/' + id
    return domain + url
  },
  //定期健康巡检未完成任务计数
  inspectionRegularUnfinishedTaskUrl() {
    const url = '/dcom/api/w/hn/inspection/task/health/unfinished/task/number'
    return domain + url
  },
  // 重保巡检任务详细
  inspectionServiceTaskDetailUrl(id) {
    const url = '/dcom/api/w/insurance/register/task/' + id
    return domain + url
  },
  // 重保巡检分类(前后)的详细信息
  inspectionServiceDetailUrl(id, type) {
    const url = '/dcom/api/w/insurance/register/task/inspection/' + id + "/" + type
    return domain + url
  },
  // 重保巡检前后结果上报
  inspectionServiceBeforeUrl(id) {
    const url = '/dcom/api/w/insurance/register/task/inspection/submit/' + id
    return domain + url
  },
  // 重保巡检每日上报的任务
  inspectionServiceReportListUrl(id) {
    const url = '/dcom/api/w/insurance/register/task/report/' + id
    return domain + url
  },
  // 重保巡检每日上报任务提交
  inspectionServiceReportUrl(id) {
    const url = '/dcom/api/w/insurance/register/task/report/' + id
    return domain + url
  },
  // 重保巡检服务总结
  inspectionServiceSummary(id) {
    const url = '/dcom/api/w/insurance/register/task/summary/' + id
    return domain + url
  },
  //重保巡检待办任务数
  inspectionServiceUnfinishedTaskUrl() {
    const url = '/dcom/api/w/insurance/register/task/p?sort=startTime,desc&size=2000&s_status=pending'
    return domain + url
  },
  //重保服务上传附件到mongo
  inspectionServiceUploadFileUrl() {
    const url = '/dcom/api/w/insurance/register/task/summary/upload'
    return domain + url
  },
  // 重保服务删除附件
  inspectionServiceDeleteFileUrl(fsId) {
    const url = '/dcom/api/w/insurance/register/task/summary/files/' + fsId
    return domain + url
  },
  // 工作总结任务列表
  questionnaireUrl() {
    const url = '/dcom/api/w/questionnires'
    return domain + url
  },
  // 工作总结待办任务列表
  questionnaireUnfinishedUrl(role) {
    const url = '/dcom/api/w/questionnires?s_published=true&s_todo=true&s_scope=' + role
    return domain + url
  },
  // 工作总结任务详情
  questionnaireDetailUrl(id) {
    const url = '/dcom/api/w/questionnires/' + id
    return domain + url
  },
  // 查询工作总结表单
  feedbackByTaskIdUrl(taskId) {
    const url = '/dcom/api/w/feedbacks/task/' + taskId
    return domain + url
  },
  // 更新工作总结表单
  updateFeedbackUrl(id) {
    const url = '/dcom/api/w/feedbacks/' + id
    return domain + url
  },
  // 创建工作总结表单
  createFeedbackUrl() {
    const url = '/dcom/api/w/feedbacks'
    return domain + url
  },
  // 更新工作总结表单
  submitFeedbackUrl(id) {
    const url = '/dcom/api/w/feedbacks/' + id + '/submit'
    return domain + url
  },
  getServiceSummaryOfWorkerUrl(year, type) {
    const url = '/dcom/api/w/workDaily/service/summary/' + year + '/' + type
    return domain + url
  }
};
